<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/common/taglibs.jsp" %>
<script type="text/javascript">
<!--
	function selectVisitReportorg(){
		var dlgId = "report";
		var title="选择部门";
		var url = ctx+"/common/organization-ui!getOrgUL.action?code=ROOT&idInput=visitPerManMonthlyOrgId&nameInput=visitPerManMonthlyOrgName&form=visitPerManMonthly&dlgID=report";
		$.pdialog.open(url, dlgId, title,{width:600,height:400});
	}
function exportvisitPerManMonthly(){
	var url = "${ctx }/crm/report/visit-per-man-monthly!export.action";
	var ym = $("#VisitReport").val();
	var org = $("#visitPerManMonthlyOrgId").val();
	url+="?";
	url+="ym="+ym;
	url+="&org="+org;
	window.open(url);
	}
//-->
</script>
<form id="pagerForm" method="post" action="${ctx }/crm/report/visit-per-man-monthly.action">
	<input type="hidden" name="status" value="${param.status}">
	<input type="hidden" name="keywords" value="${param.keywords}" />
	<input type="hidden" name="pageNum"  value="${page.pageNo}" />
	<input type="hidden" name="numPerPage" id="numPerPage" value="${page.pageSize}" />
	<input type="hidden" name="orderField" value="${param.orderField}" />
</form>
<div class="page">
	<div class="pageHeader">
		<form id="visitPerManMonthly" onsubmit="return navTabSearch(this);" action="${ctx }/crm/report/visit-per-man-monthly.action" method="post">
		<div class="searchBar">
			<ul class="searchContent">
				<li>
					<label>选择月份：</label>
					<span>
					<input type="text" name="ym" id="VisitReport" size="20" value="${ym}" onfocus="WdatePicker({el:'VisitReport',dateFmt:'yyyy-MM'})"/>
					</span>
				</li>
				<li>
					<label>选择部门：</label>
					<span>
					<input type="hidden" name="org" id="visitPerManMonthlyOrgId" size="20" value="${org}"/>
					<input type="text" name="orgName" id="visitPerManMonthlyOrgName" size="20" value="" onfocus="selectVisitReportorg();"/>
					<!-- 
					<a class="inputButton" href="${ctx }/common/organization-ui!getOrgUL.action?code=ROOT&idInput=org&nameInput=orgName&form=goodspermanmonthly&dlgID=report" target="dialog" rel="report">选择部门</a>
					 -->
					</span>
				</li>
			</ul>
			<div class="subBar">
				<ul>
					<li><div class="buttonActive"><div class="buttonContent"><button type="submit"> 检 索 </button></div></div></li>
					<li><div class="buttonActive"><div class="buttonContent"><button type="button" onclick="exportvisitPerManMonthly()"> 导 出 </button></div></div></li>
				</ul>
			</div>
		</div>
		</form>
	</div>
	<div class="pageContent">
		 <div id="visitPerManMonthlyDiv" >
		 <br>
			请按条件查询！
		</div>					

		<script language="JavaScript">		
			
			var data="";			
			var year = "${ym}";
			var depart="";
			<s:iterator value="list" var="obj">
			data+="<set label='${obj[0]}' value='${obj[2]}' />";
			depart = "${obj[1]}";
			</s:iterator>	
			if(data!=""){
				var month = year.substr(year.indexOf("-")+1);
				year = year.replace("-"+month,"");
				year = year+"年"+month+"月";
				
				
				var chart1 = new FusionCharts(Column3D, "chart1Id", "800", "350", "0", "1");				
				var xml = "<chart caption='"+year+depart+"回访量对比' xAxisName='业务员' yAxisName='回访数（个）'";
				xml+=" rotateYAxisName='1' baseFont='宋体' baseFontSize='14' palette='10'";
				xml+=" showBorder='0' exportEnabled='1' exportHandler='"+explorer+"' exportAtClient='0' exportAction='download'";
				xml+=" exportFileName='SoGoodSoft'";
				xml+=" >"
				xml+=data;
				xml+="</chart>";
				chart1.setDataXML(xml);
				chart1.render("visitPerManMonthlyDiv");
			}
		</script>



	</div>
</div>